package merlin.beans;

import java.text.*;
import java.util.Date;

public class IndustrySourceListingBean{

	private int sourceId;
	private int reportNumber;
	private String url;
	private String notes;
	private boolean associationIndicator;
	private int qualityScore;
	private Date dateLastChecked;
	private String dateLastCheckedString;


	public IndustrySourceListingBean(){
	}

	public IndustrySourceListingBean(int sourceId,int reportNumber,String url,String notes,boolean associationIndicator,int qualityScore,Date dateLastChecked){
		this.sourceId	= sourceId;
		this.reportNumber = reportNumber;
		this.url	= url;
		this.notes = notes;
		this.associationIndicator = associationIndicator;
		this.qualityScore = qualityScore;
		this.dateLastChecked = dateLastChecked;
	}

	public int getSourceId() {
		return sourceId;
	}

	public void setSourceId(int value) {
		sourceId = value;
	}

	public boolean isAssociationIndicator() {
		return associationIndicator;
	}

	public void setAssociationIndicator(boolean value) {
		associationIndicator = value;
	}

	public java.lang.String getNotes() {
		return notes;
	}

	public void setNotes(java.lang.String value) {
		notes = value;
	}

	public int getQualityScore() {
		return qualityScore;
	}

	public void setQualityScore(int value) {
		qualityScore = value;
	}

	public int getReportNumber() {
		return reportNumber;
	}

	public void setReportNumber(int value) {
		reportNumber = value;
	}

	public java.lang.String getUrl() {
		return url;
	}

	public void setUrl(java.lang.String value) {
		url = value;
	}

	public java.lang.String getDateLastCheckedString() {
		return dateLastCheckedString;
	}

	public java.util.Date getDateLastChecked() {
		return dateLastChecked;
	}

	public void setDateLastChecked(java.util.Date value) {
		dateLastChecked = value;
		// update the dateString value also.
		try{
			SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
			dateLastCheckedString =  df.format(dateLastChecked);
		}catch(Exception e){
			e.printStackTrace();
		}
	}

	public void setDateLastCheckedString(java.lang.String value) {
		dateLastCheckedString = value;
		//update the dateLastChecked value also.
		try{
			SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
			dateLastChecked =  df.parse(dateLastCheckedString);
		}catch(Exception e){
			e.printStackTrace();
		}

	}
}
